package com.yl.pattern.behavioralmodel.interpreter;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author 小羊
 * @Date 1/11/2024下午 8:48
 * @ClassName Context
 * @Description 环境角色类
 */
public class Context {
    private Map<Variable,Integer> map = new HashMap<>();

    public void assign(Variable var,Integer val){
        map.put(var, val);
    }

    public int getValue(Variable var){
        return map.get(var);
    }
}
